package com.words.dao;

import com.words.entity.Cet6Words;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
@Mapper
public interface WordDao {
    @Select("select * from cet6words order by id asc")
    List<Cet6Words> findAll();

    @Select("select * from cet6words where word = #{word}")
    List<Cet6Words> findByWord(String word);

    //多参数要加上@Param注解
    @Update("update cet6words set note=#{note} where id=#{id}")
    void addNote(@Param("id") int id, @Param("note") String note);

    @Update("update cet6words set note= '' where id=#{id}")
    void deleteNote(int id);

}
